<template>
  <avue-crud :data="data"
             v-model="form"
             :before-close="beforeClose"
             :option="option"></avue-crud>
</template>
<script>
export default {
  data () {
    return {
      form: {},
      data: [{
        name: '张三',
        sex: '男'
      }],
      option: {
        column: [
          {
            label: '姓名',
            prop: 'name'
          }, {
            label: '性别',
            prop: 'sex'
          }
        ]
      },
    };
  },
  methods: {
    beforeClose (done, type) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done();
        })
        .catch(_ => { });

    }
  }
};
</script>